package cn.tedu._01mvcboot01.controller;

import cn.tedu._01mvcboot01.pojo.dto.UpdateCarDTO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CarController {
    @PostMapping("/v1/car/add")
    @ResponseBody
    public String addCar(String brand,String license,double price){
        System.out.println("添加车辆："+brand+","+license+","+price);
        return "添加成功,"+brand+"-"+license+"-"+price;
    }

    @RequestMapping("/v1/car/update")
    @ResponseBody
    public String updateCar(UpdateCarDTO updateCarDTO){
        System.out.println("更新车辆："+updateCarDTO);
        return "更新车辆成功";
    }
}
